import { IFeidaoAiBrowserComponent } from '@dfeidao/atom-web/interfaces';
import nodejs from '@dfeidao/atom-web/msg/nodejs';
import render from '@dfeidao/atom-web/render/render';
import set_node_cls from '@dfeidao/atom-web/ui/set-node-cls';
import show from '@dfeidao/atom-web/ui/show';
import p001 from './p001';
import p002 from './p002';

export default async function a001(fd: IFeidaoAiBrowserComponent, paper_number1: string, exam_score: number, exam_name: string) {
	// todo
	// 数据
	const res2 = await nodejs<{ dt: Array<{ exam_score: number, paper_number: string }> }>('employee-examination/zj-000004/s001',
		{
			filter: {
				paper_number: paper_number1
			}
		});
	// 渲染p002
	const arr = [{ exam_name, exam_score }];
	render(fd, arr, p002, 'p002', 'inner');
	render(fd, res2.dt, p001, 'p001', 'inner');
	const up = fd.data.node.querySelector<HTMLDivElement>('[data-id="xiangQing"]');
	set_node_cls(up, 'display-n', false);
	show(fd.data.node);
}
